package com.ruoyi.hospital.service.shop.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.hospital.domain.shop.PharmacyDrugSku;
import com.ruoyi.hospital.mapper.shop.PharmacyDrugSkuMapper;
import com.ruoyi.hospital.service.shop.IPharmacyDrugSkuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * sku信息Service业务层处理
 * 
 * @author wendao
 * @date 2024-09-24
 */
@Service
public class PharmacyDrugSkuServiceImpl implements IPharmacyDrugSkuService
{
    @Autowired
    private PharmacyDrugSkuMapper pharmacyDrugSkuMapper;

    /**
     * 查询sku信息
     * 
     * @param id sku信息主键
     * @return sku信息
     */
    @Override
    public PharmacyDrugSku selectPharmacyDrugSkuById(Integer id)
    {
        return pharmacyDrugSkuMapper.selectPharmacyDrugSkuById(id);
    }

    /**
     * 查询sku信息列表
     * 
     * @param pharmacyDrugSku sku信息
     * @return sku信息
     */
    @Override
    public List<PharmacyDrugSku> selectPharmacyDrugSkuList(PharmacyDrugSku pharmacyDrugSku)
    {
        return pharmacyDrugSkuMapper.selectPharmacyDrugSkuList(pharmacyDrugSku);
    }

    @Override
    public List<PharmacyDrugSku> selectPharmacyDrugSkuListInskuIds(List<Integer> skuIds) {
        return pharmacyDrugSkuMapper.selectPharmacyDrugSkuListInskuIds(skuIds);
    }

    /**
     * 新增sku信息
     * 
     * @param pharmacyDrugSku sku信息
     * @return 结果
     */
    @Override
    public int insertPharmacyDrugSku(PharmacyDrugSku pharmacyDrugSku)
    {
        pharmacyDrugSku.setCreateTime(DateUtils.getNowTimeSecond());
        return pharmacyDrugSkuMapper.insertPharmacyDrugSku(pharmacyDrugSku);
    }

    /**
     * 修改sku信息
     * 
     * @param pharmacyDrugSku sku信息
     * @return 结果
     */
    @Override
    public int updatePharmacyDrugSku(PharmacyDrugSku pharmacyDrugSku)
    {
        pharmacyDrugSku.setUpdateTime(DateUtils.getNowTimeSecond());
        return pharmacyDrugSkuMapper.updatePharmacyDrugSku(pharmacyDrugSku);
    }

    /**
     * 批量删除sku信息
     * 
     * @param ids 需要删除的sku信息主键
     * @return 结果
     */
    @Override
    public int deletePharmacyDrugSkuByIds(Integer[] ids)
    {
        return pharmacyDrugSkuMapper.deletePharmacyDrugSkuByIds(ids);
    }

    /**
     * 删除sku信息信息
     * 
     * @param id sku信息主键
     * @return 结果
     */
    @Override
    public int deletePharmacyDrugSkuById(Integer id)
    {
        return pharmacyDrugSkuMapper.deletePharmacyDrugSkuById(id);
    }
}
